package logic.collegeQuery_logic;

import java.util.LinkedList;
import java.util.List;

import javaRMI.RMIClient;
import po.CollegePO;
import po.StudentPO;
import po.TeacherPO;
import vo.CollegeListVO;
import datasv.collegeQuery_datasv.CollegeQueryDatasv;
import datasv.datafactorysv.CollegeQueryDatasvFactory;

public class CollegeQuery{
	private CollegeQueryDatasv collegeQD;
	
	public CollegeQuery(RMIClient rmi){
		collegeQD = new CollegeQueryDatasvFactory(rmi).create();
	}
	
	public CollegeListVO getCollegeList() {
		List<CollegePO> list = collegeQD.getCollegeList();
		if(list == null){
			list = new LinkedList<CollegePO>();
		}
		CollegeListVO collegeList = new CollegeListVO(list);
		return collegeList;
	}
	public List<TeacherPO> getCollegeTeacherPOList(String collegeID){
		List<TeacherPO> teacherPOList = collegeQD.getCollegeTeacherPOList(collegeID);
		return teacherPOList;
	}
	public List<StudentPO> getCollegeStudentPOList(String collegeID){
		List<StudentPO> studentPOList = collegeQD.getCollegeStudentPOList(collegeID);
		return studentPOList;
	}
}
